<?php

require_once '/usr/share/php/symfony/autoload/sfCoreAutoload.class.php';
sfCoreAutoload::register();

class ProjectConfiguration extends sfProjectConfiguration
{
	public function setup()
	{
		$this->enablePlugins('sfDoctrinePlugin');
		$this->dispatcher->connect('mailer.configure',array($this,'configureMailer'));
	}

	public function configureMailer(sfEvent $event){
		$mailer = $event->getSubject();
		$transport = $mailer->getRealtimeTransport();

		$transport->registerPlugin(new Swift_Plugins_ThrottlerPlugin(
		100, Swift_Plugins_ThrottlerPlugin::MESSAGES_PER_MINUTE
		));

		$transport->registerPlugin(new Swift_Plugins_AntiFloodPlugin(30));
	}
}
